package com.mang.school.controller;



import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.mang.school.bean.School;

@Controller
@RequestMapping("/school")
public class SchoolController {
	
	private static final Logger logger = LoggerFactory.getLogger(SchoolController.class);
	
	@RequestMapping(value = "/{id}", method=RequestMethod.GET)
	public @ResponseBody School getSchool(@PathVariable String id) {
		logger.info("getSchool...{}", id);
		School school = new School();
		school.setId(id);
		school.setName("Setupathi Higher Secondary School");
		return school;
	}
	
	@RequestMapping(method = RequestMethod.DELETE)
	public String deleteSchool(@PathVariable String id){
		return "Success";
	}

}
